//
//  JZBAddFoodFooter.m
//  JZB
//
//  Created by liujianlong on 2022/8/31.
//

#import "JZBAddFoodFooter.h"
@interface JZBAddFoodFooter()
@property (strong, nonatomic) IBOutlet UIButton *btn1;
@property (strong, nonatomic) IBOutlet UIButton *btn2;
@property (strong, nonatomic) IBOutlet UIButton *btn3;
@property (strong, nonatomic) IBOutlet UIButton *btn4;
@property (strong, nonatomic) IBOutlet UIButton *btn5;
@property (nonatomic, strong) NSMutableArray *array;

@end
@implementation JZBAddFoodFooter
- (void)awakeFromNib{
    [super awakeFromNib];
    self.array = [NSMutableArray array];
    [self.array addObjectsFromArray:@[self.btn1,self.btn2,self.btn3,self.btn4,self.btn5]];
}
- (IBAction)actionforBtn:(UIButton *)sender {
    for (UIButton *btn in self.array) {
        UIColor *color = [UIColor colorWithHexString: btn.tag == sender.tag ? @"#F9DB61" : @"#EEEEEE"];
        [btn setBackgroundColor:color];
    }
    if (self.block) {
        self.block((int)sender.tag);
    }
}

@end
